require("../../common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pagesA/pages/movieA/city" ], {
    "2cdb": function(t, e, n) {
        var a = n("6fae");
        n.n(a).a;
    },
    "6fae": function(t, e, n) {},
    "90f5": function(t, e, n) {
        n.r(e);
        var a, i = n("bd0e"), c = n.n(i);
        for (a in i) "default" !== a && function(t) {
            n.d(e, t, function() {
                return i[t];
            });
        }(a);
        e.default = c.a;
    },
    bd0e: function(t, n, o) {
        (function(a) {
            Object.defineProperty(n, "__esModule", {
                value: !0
            }), n.default = void 0;
            var t, i = (t = o("a34a")) && t.__esModule ? t : {
                default: t
            };
            function s(t, e, n, a, i, c, o) {
                try {
                    var r = t[c](o), s = r.value;
                } catch (t) {
                    return n(t), 0;
                }
                r.done ? e(s) : Promise.resolve(s).then(a, i);
            }
            var c = getApp(), e = {
                data: function() {
                    return {
                        module_name: c.globalData.module_name,
                        setting: a.getStorageSync("setting"),
                        userinfo: a.getStorageSync("userinfo"),
                        mainHeight: 500,
                        cityData: [],
                        AZ: [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "W", "X", "Y", "Z" ],
                        currentCity: "",
                        currentCityid: 0,
                        hotCities: [ {
                            cityId: 1,
                            pinYin: "S",
                            regionName: "上海"
                        }, {
                            cityId: 3,
                            pinYin: "B",
                            regionName: "北京"
                        }, {
                            cityId: 16,
                            pinYin: "H",
                            regionName: "杭州"
                        }, {
                            cityId: 8,
                            pinYin: "G",
                            regionName: "广州"
                        }, {
                            cityId: 63,
                            pinYin: "N",
                            regionName: "南京"
                        }, {
                            cityId: 107,
                            pinYin: "S",
                            regionName: "苏州"
                        }, {
                            cityId: 28,
                            pinYin: "S",
                            regionName: "深圳"
                        }, {
                            cityId: 70,
                            pinYin: "C",
                            regionName: "成都"
                        }, {
                            cityId: 40,
                            pinYin: "C",
                            regionName: "重庆"
                        }, {
                            cityId: 22,
                            pinYin: "T",
                            regionName: "天津"
                        } ],
                        showCityId: "",
                        searchTimer: null,
                        searchIndex: -1,
                        lon: "",
                        lat: ""
                    };
                },
                onShow: function() {
                    a.hideLoading();
                },
                onLoad: function(t) {
                    var r, n = this;
                    return r = i.default.mark(function t() {
                        var e;
                        return i.default.wrap(function(t) {
                            for (;;) switch (t.prev = t.next) {
                              case 0:
                                return t.next = 2, n.$onLaunched;

                              case 2:
                                (e = n).setting = a.getStorageSync("setting"), e.tabBar = a.getStorageSync("tabbar"), 
                                e.userinfo = a.getStorageSync("userinfo"), a.hideLoading(), n.module_name = c.globalData.module_name, 
                                n.loadcityData();

                              case 11:
                              case "end":
                                return t.stop();
                            }
                        }, t);
                    }), function() {
                        var t = this, o = arguments;
                        return new Promise(function(e, n) {
                            var a = r.apply(t, o);
                            function i(t) {
                                s(a, e, n, i, c, "next", t);
                            }
                            function c(t) {
                                s(a, e, n, i, c, "throw", t);
                            }
                            i(void 0);
                        });
                    }();
                },
                onReady: function() {
                    var n = this;
                    setTimeout(function() {
                        a.createSelectorQuery().select("#gBody").fields({
                            size: !0
                        }, function(e) {
                            a.createSelectorQuery().select("#hSearch").fields({
                                size: !0
                            }, function(t) {
                                n.mainHeight = e.height - t.height;
                            }).exec();
                        }).exec();
                    }, 1e3);
                },
                methods: {
                    loadcityData: function() {
                        var e = this, t = c.globalData.util.url("entry/wxapp/moviecity2", {
                            m: c.globalData.module_name
                        });
                        a.request({
                            url: t,
                            method: "POST",
                            header: {
                                "content-type": "application/x-www-form-urlencoded"
                            },
                            data: {},
                            success: function(t) {
                                e.cityData = t.data, e.getLocation();
                            }
                        });
                    },
                    getLocation: function() {
                        a.showLoading({
                            title: "加载中...",
                            mask: !1
                        });
                        var n = this;
                        a.getLocation({
                            type: "wgs84",
                            success: function(t) {
                                var e = c.globalData.util.url("entry/wxapp/address", {
                                    m: c.globalData.module_name
                                });
                                a.setStorageSync("lon", t.longitude), a.setStorageSync("lat", t.latitude), a.request({
                                    url: e,
                                    method: "POST",
                                    header: {
                                        "content-type": "application/x-www-form-urlencoded"
                                    },
                                    data: {
                                        lon: t.longitude,
                                        lat: t.latitude
                                    },
                                    success: function(t) {
                                        a.setStorageSync("cityid", t.data.data.ci), a.setStorageSync("cityCode", t.data.data.cityCode), 
                                        a.setStorageSync("city", t.data.data.city), n.currentCity = t.data.data.city, n.currentCityid = t.data.data.ci, 
                                        a.hideLoading();
                                    }
                                });
                            },
                            fail: function(t) {
                                a.hideLoading(), a.showModal({
                                    title: "系统提示",
                                    content: "请授权获取您的位置信息",
                                    showCancel: !0,
                                    success: function(t) {
                                        t.confirm && n.again_getLocation();
                                    }
                                });
                            }
                        });
                    },
                    again_getLocation: function() {
                        var e = this;
                        a.getSetting({
                            success: function(t) {
                                null != t.authSetting["scope.userLocation"] && 1 != t.authSetting["scope.userLocation"] ? a.showModal({
                                    title: "是否授权当前位置",
                                    content: "需要获取您的地理位置，请确认授权，否则无法获取您所需数据",
                                    success: function(t) {
                                        t.cancel ? a.showToast({
                                            title: "授权失败",
                                            icon: "success",
                                            duration: 1e3
                                        }) : t.confirm && a.openSetting({
                                            success: function(t) {
                                                1 == t.authSetting["scope.userLocation"] ? (a.showToast({
                                                    title: "授权成功",
                                                    icon: "success",
                                                    duration: 1e3
                                                }), e.getLocation(e)) : a.showToast({
                                                    title: "授权失败",
                                                    icon: "success",
                                                    duration: 1e3
                                                });
                                            }
                                        });
                                    }
                                }) : (t.authSetting["scope.userLocation"], e.getLocation(e));
                            }
                        });
                    },
                    chooseCity: function(t) {
                        var e = t.currentTarget.dataset.cityname, t = t.currentTarget.dataset.citycode;
                        a.setStorageSync("cityname", e), a.setStorageSync("cityid", t), this.currentCity = e, 
                        a.navigateBack({
                            delta: 1
                        });
                    },
                    search: function(t) {
                        var e = this;
                        "" != (t = t.toLowerCase()) ? (null != this.searchTimer && clearTimeout(this.searchTimer), 
                        this.searchTimer = setTimeout(function() {
                            e.searchBase(t);
                        }, 500)) : this.showCityId = "pageTop";
                    },
                    searchBase: function(t) {
                        for (var e in this.searchIndex = -1, this.cityData) {
                            for (var n = 0; n < this.cityData[e].length; n++) if (0 == this.cityData[e][n].regionName.indexOf(t) || 0 == this.cityData[e][n].pinYin.indexOf(t)) {
                                this.searchIndex = this.cityData[e][n].cityId;
                                break;
                            }
                            if (-1 != this.searchIndex) break;
                        }
                        -1 != this.searchIndex && (this.showCityId = "grace-city-list-" + this.searchIndex);
                    },
                    changAZ: function(t) {
                        t = t.currentTarget.dataset.char;
                        this.showCityId = "grace-city-AZ-" + t;
                    }
                },
                components: {
                    gracePage: function() {
                        o.e("graceUI/components/gracePage").then(function() {
                            return resolve(o("1021"));
                        }.bind(null, o)).catch(o.oe);
                    },
                    graceSearch: function() {
                        o.e("graceUI/components/graceSearch").then(function() {
                            return resolve(o("de21"));
                        }.bind(null, o)).catch(o.oe);
                    }
                }
            };
            n.default = e;
        }).call(this, o("543d").default);
    },
    d76e: function(t, e, n) {
        n.r(e);
        var a, i = n("ee1d"), c = n("90f5");
        for (a in c) "default" !== a && function(t) {
            n.d(e, t, function() {
                return c[t];
            });
        }(a);
        n("2cdb");
        var o = n("f0c5"), i = Object(o.a)(c.default, i.b, i.c, !1, null, null, null, !1, i.a, void 0);
        e.default = i.exports;
    },
    e866: function(t, e, n) {
        (function(t) {
            function e(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            n("0cda"), e(n("66fd")), t(e(n("d76e")).default);
        }).call(this, n("543d").createPage);
    },
    ee1d: function(t, e, n) {
        n.d(e, "b", function() {
            return a;
        }), n.d(e, "c", function() {
            return i;
        }), n.d(e, "a", function() {});
        var a = function() {
            this.$createElement;
            this._self._c;
        }, i = [];
    }
}, [ [ "e866", "common/runtime", "common/vendor" ] ] ]);